<template>
  <figure>
    <img :src="movie.img|replace" alt />
    <div>
      <h3>
        <figcaption>{{movie.nm}}</figcaption>
        <mark>{{movie.version}}</mark>
      </h3>
      <div v-if="movie.sc==0">
        <span>{{movie.wish}}</span>想看
      </div>
      <div v-else>
        <span>{{movie.sc}}</span>观众评
      </div>
      <div>主演:{{movie.star}}</div>
      <div>{{movie.showInfo}}</div>
    </div>
    <div @click="handClick">购票</div>
  </figure>
</template>

<script>
export default {
  components: {},
  props: {
    movie: Object
  },
  filters: {
    replace: function(val) {
      return val.replace("w.h", "128.180");
    }
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    handClick: function() {
      let isLogin = true;
      if (isLogin) {
        this.$router.push({ path: "/buy" });
      } else {
        this.$router.push({ path: "/login" });
      }
    }
  },
  created() {},
  mounted() {}
};
</script>
<style lang="scss" scoped>
figure {
  display: flex;
  img {
    flex: 0;
    flex-basis: auto;
  }
  div {
    flex: 1;
  }
  a {
    flex: 0;
    flex-basis: auto;
    word-break: keep-all;
  }
}
</style>